<%--
  Created by IntelliJ IDEA.
  User: user
  Date: 2021/7/20
  Time: 20:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>找回密码</title>
</head>
<style>
    @import "/css/daohang.css";
    @import "/css/header.css";
</style>
<div class="header_bd">
    <!-- 头部 -->

    <div class="header">
        <h1><img style="height: 50px;width: 180px"
                 src="">
        </h1>
        <form>
            <input type="text" name="search" placeholder="Search.." class="search">
        </form>
        <button class="searchButton searchButton2">立即搜索</button>
        <div class="login">
        </div>
    </div>
    <div>
        <div class="topNav">
            <!-- 导航栏 -->
            <div style="float: left;">
                <button style="" class="links_button button dropdown">
                    <a href="tuijian.jsp" style="text-decoration: none">推荐</a>
                    <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
                </button>
                <button style="" class="links_button button dropdown">
                    <a href="yingshi.jsp" style="text-decoration: none">影视</a>
                    <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
                </button>
                <button style="" class="links_button button dropdown">
                    <a href="yinyue.jsp" style="text-decoration: none">音乐</a>
                    <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
                </button>
                <button style="" class="links_button button dropdown">
                    <a href="youxi.jsp" style="text-decoration: none">游戏</a>
                    <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
                </button>
                <button style="" class="links_button button dropdown">
                    <a href="tiyu.jsp" style="text-decoration: none">体育</a>
                    <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
                </button>
                <button style="" class="links_button button dropdown">
                    <a href="zongyi.jsp" style="text-decoration: none">综艺</a>
                    <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
                </button>
                <button style="" class="links_button button dropdown">
                    <a href="yule.jsp" style="text-decoration: none">娱乐</a>
                    <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
                </button>
                <button style="" class="links_button button dropdown">
                    <a href="dongman.jsp" style="text-decoration: none">动漫</a>
                    <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
                </button>
                <button style="" class="links_button button dropdown">
                    <a href="shenghuo.jsp" style="text-decoration: none">生活</a>
                    <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
                </button>
                <button style="" class="links_button button dropdown">
                    <a href="meishi.jsp" style="text-decoration: none">美食</a>
                    <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
                </button>
                <button style="" class="links_button button dropdown">
                    <a href="chongwu.jsp" style="text-decoration: none">宠物</a>
                    <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
                </button>
            </div>
        </div>
    </div>
</div>
<body>
<script src="/js/jquery/jquery-3.3.1.js"></script>
<script>
    function update_password() {
        var password = $(':password[name="password"]').val();
        var pwdReg = /^(?=.*[0-9])(?=.*[a-zA-Z]).{8,30}$/;
        if (!pwdReg.test(password)) {
            alert('密码由字母、数字、其它符号组成,长度为8到30');
            return;
        }
        var password_two = $(':password[name="password_two"]').val();
        if (password != password_two) {
            alert('两次密码需输入一致');
            return;
        }
        $('form').submit();
    }
</script>
<div style="width:100%;height:100%">
    <form action="/user/update_password_by_code" method="post">
        <div style="height:250px;width:300px;background-image: linear-gradient(to bottom right, white, aqua); border-radius: 25px;position: fixed;left: 600px;top:200px">
            <ul style="list-style: none;line-height: 28px">
                <li><h3 style="text-align:center;border-radius: 15px;letter-spacing:15px">找回密码</h3></li>
                <li><span>新密码:</span><input style="border-radius: 15px;" type="password" name="password"
                                            placeholder="请输入新密码" required></li>
                <li><span>确认密码:</span><input style="border-radius: 15px;" type="password" name="password_two"
                                             placeholder="请确认密码" required></li>
                <li>
                    <button type="button" onclick="update_password()">修改密码</button>
                </li>
                <li><input type="hidden" name="email" value="${param.email}">
                    <input type="hidden" name="rd_str" value="${param.rd_str}">
                    <input type="hidden" name="timeout" value="${param.timeout}">
                    <input type="hidden" name="sign" value="${param.sign}">
                </li>
            </ul>
        </div>
    </form>
</div>
</body>
</html>
